//
//  OO_ToBeCell.m
//  ShopProject
//
//  Created by macbookpro on 2018/10/2.
//  Copyright © 2018年 ShopProject. All rights reserved.
//

#import "OO_ToBeCell.h"
@interface OO_ToBeCell()
@property (weak, nonatomic) IBOutlet UIImageView *goodsImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLable;
@property (weak, nonatomic) IBOutlet UILabel *priceLable;
@property (weak, nonatomic) IBOutlet UILabel *numberLable;
@property (weak, nonatomic) IBOutlet UILabel *timeLable;

@end
@implementation OO_ToBeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setModel:(OO_OrderModel *)model{
    _model = model;
    self.nameLable.text = model.goodsName;
    
    self.timeLable.text = model.time;
    
    self.priceLable.text =   [NSString stringWithFormat:@"¥%@",model.price];
    
    self.numberLable.text =  [NSString stringWithFormat:@"X%ld",model.goodsNumber];
    
    [self.goodsImageView sd_setImageWithURL:[NSURL URLWithString:model.goodsImageUrl] placeholderImage:[UIImage imageNamed:IMAGEPLACEHOLDER]];
    
}
- (IBAction)operationButtonPress:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(operationButtonClickedAtCell:)]) {
        [self.delegate operationButtonClickedAtCell:self];
    }
    
}
- (IBAction)payButtonPress:(UIButton *)sender {
    if ([self.delegate respondsToSelector:@selector(payButtonClickedAtCell:)]) {
        [self.delegate payButtonClickedAtCell:self];
    }
}

@end
